using Microsoft.Xna.Framework;

namespace BruteForce.UserInterface.Abstracts
{
    public abstract class AbstractUIControl
    {
        protected Rectangle CurrentUIcontrolRectangle;
        protected bool Focused;
        public string Name;
        protected Rectangle RelativeUIcontrolRectangle;

        protected AbstractUIControl(string UIcontrolName, Rectangle relativeSurroundingRectangle)
        {
            Name = UIcontrolName;
            RelativeUIcontrolRectangle = relativeSurroundingRectangle;
            CurrentUIcontrolRectangle = relativeSurroundingRectangle;
        }

        public bool IsFocused()
        {
            return Focused;
        }

        public void RemoveFocus()
        {
            Focused = false;
        }

        public void AddFocus()
        {
            Focused = true;
        }

        public void SetOffset(Vector2 offset)
        {
            CurrentUIcontrolRectangle.X = RelativeUIcontrolRectangle.X + (int) offset.X;

            CurrentUIcontrolRectangle.Y = RelativeUIcontrolRectangle.Y + (int) offset.Y;
        }

        public abstract void Update();

        public abstract void Draw(GameTime gameTime);
    }
}